//-----------------------------------------------------------------------------
//クラス名：End.java
//所    属：H3A1 04
//名    前：大瀬碩
//説    明：補講終了時間を保存する
//-----------------------------------------------------------------------------
package supplementary_classes;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;


//@WebServlet("/End")
public class End extends HttpServlet {
	private static final long serialVersionUID = 1L;
       

    public End() {
        super();
    }


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html; charset=UTF-8");
		request.setCharacterEncoding("UTF-8");
		HttpSession session = request.getSession(true);
		
		//補講終了時間を取得し保存する
		String et = request.getParameter("et");
		String etr = request.getParameter("etr");
		
		session.setAttribute("et", et);
		session.setAttribute("etr", etr);
		session.setAttribute("etbtn", "ON");
		
		//テキストエリアを使用可能にする
		Object stbtn = session.getAttribute("stbtn");
		if("ON".equals(stbtn)){
			session.setAttribute("actedit", "OFF");
		}
		
		RequestDispatcher rd = request.getRequestDispatcher("SupplementaryClasses.jsp");
		rd.forward(request,response);
	}

}